﻿@model PagedResult<token_bazaar_product_dto>
@{
    var img_url = ViewBag.img_url;
    if(Model.rows.Count > 0) {
        foreach (var item in Model.rows) {
            <li>
                <div class="content">
                    <div class="img">
                        <img src="@(img_url + item.main_img)" />
                    </div>
                    <div class="text">
                        <p class="mb20 fn-pfBold">
                            <a class="fn28" href="">
                                @item.product_name
                            </a>
                        </p>
                        <div class="price fn24 col-gray">
                            ￥<span class="col-red fn30 fn-pfBold">@item.market_price.ToString("f2")</span> @*红钻*@
                            @{ string status_des = string.Empty;
                                string colorStyle = "green";
                                if (item.status == EBazaarProductStatus.Auditing) { status_des = "审核中"; colorStyle = "red"; }
                                else if (item.status == EBazaarProductStatus.Upper) { status_des = "已发布"; colorStyle = "green"; }
                                else if (item.status == EBazaarProductStatus.Down) { status_des = "违规下架"; colorStyle = "col-gray"; }
                                else if (item.status == EBazaarProductStatus.Traded) { status_des = "已交易"; colorStyle = "col-gray"; }
                            }
                            <span class="fn28 release-state @colorStyle">@status_des</span>
                        </div>
                    </div>
                </div>
                <div class="btnBox">
                    @if (item.status == EBazaarProductStatus.Upper) {
                        <button class="ui-btn ui-btn-share ui-btn-180 product_share" type="button" data-title="@item.product_name" data-desc="@item.prodcut_desc" data-imgurl="@(img_url + item.main_img)" data-id="@item.id">分享</button>
                    }
                    <button class="ui-btn  ui-btn-share ui-btn-defaults ui-btn-180 product_edit" data-id="@item.id" type="button">编辑</button>
                    <button class="ui-btn  ui-btn-share ui-btn-defaults ui-btn-180 product_del"  data-id="@item.id" type="button">删除</button>
                </div>
            </li>
        }
    }
    <page rows="@Model.rows.Count()" total_result="@Model.total_result"></page>
}




